/**
 * @brief sha256计算模块
 * @version 1.0
 * @author 宋炜
 * @date
 */
#include <string>
#include <openssl/evp.h>

#pragma once

class sha256
{
private:
    EVP_MD_CTX    * p_ctx__;

public:
    sha256();
    sha256( const std::string& data );
    sha256( void * data , size_t len );
    ~sha256();

    void update( const void * data , size_t len );
    std::string finish();

    inline std::string str(){ return finish(); }
};
